package com.chatinterfaceuni.entity;


import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * 通用结果信息类 基类
 *
 * @author xuxiaogang
 * @date 2019-11-26
 */
@Data
@AllArgsConstructor
public class BaseCommonResult {
    private Integer code;
    private String message;
    private Object data;
    private Boolean success;

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public Object getData() {
        return data;
    }

    public Boolean getSuccess() {
        return success;
    }

    public BaseCommonResult() {
        code = 20000;
        message = "调用成功";
        data = "";
    }

    public BaseCommonResult(Object data) {
        code = 20000;
        message = "调用成功";
        this.data = data;
        this.success = true;
    }

    public BaseCommonResult(Object data, Boolean success) {
        code = 20000;
        message = "调用成功";
        this.data = data;
        this.success = success;
    }



    public BaseCommonResult(String msg) {
        code = 20000;
        message = msg;
        this.data = "";
    }
    public BaseCommonResult(Object data, String msg) {
        code = 20000;
        message = msg;
        this.data = data;
    }
}
